import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    showFlag: localStorage.getItem('showFlag') ? !!+localStorage.getItem('showFlag') : false,
    fullScreen: localStorage.getItem('fullScreen') ? !!+localStorage.getItem('fullScreen') : false,
    leftInter: false
  },
  getters: {
  },
  mutations: {
    setShowFlag(state) {
      state.showFlag = !state.showFlag
      if (state.showFlag) {
        localStorage.setItem('showFlag', 0)
      } else {
        localStorage.setItem('showFlag', 1)
      }
    },
    setfullScreen(state) {
      state.fullScreen = !state.fullScreen
      if (state.fullScreen) {
        localStorage.setItem('fullScreen', 0)
      } else {
        localStorage.setItem('fullScreen', 1)
      }
    },
    setInterFlag(state, flag) {
      state.leftInter = flag
    }
  },
  actions: {
  },
  modules: {

  }
})
